#! /bin/bash
# Manual customization of this file is not recommended.
{% if inventory_hostname in groups['fileserver'] %}
for port in 80 8080; do
  firewall-cmd --permanent --add-port=$port/tcp
done
{% endif %}

{% if inventory_hostname in groups['peer'] %}
for port in 7050 7051 7052 7053; do
  firewall-cmd --permanent --add-port=$port/tcp
done
{% endif %}

{% if inventory_hostname in groups['rootnode'] %}
for port in 7050 7051 7052 7053; do
  firewall-cmd --permanent --add-port=$port/tcp
done
{% endif %}

{% if inventory_hostname in groups['membership'] %}
for port in 7054 7055 7056 7057 7058 7059; do
  firewall-cmd --permanent --add-port=$port/tcp
done
{% endif %}

{% if inventory_hostname in groups['registry'] %}
firewall-cmd --permanent --add-port=5000/tcp
{% endif %}
